/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author amega
 */
@Entity
@Table(name = "hallImg")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HallImg.findAll", query = "SELECT h FROM HallImg h"),
    @NamedQuery(name = "HallImg.findById", query = "SELECT h FROM HallImg h WHERE h.id = :id"),
    @NamedQuery(name = "HallImg.findByFileName", query = "SELECT h FROM HallImg h WHERE h.fileName = :fileName")})
public class HallImg implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "fileName")
    private String fileName;
    @JoinColumn(name = "idHall", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Hall idHall;

    public HallImg() {
    }

    public HallImg(Integer id) {
        this.id = id;
    }

    public HallImg(Integer id, String fileName) {
        this.id = id;
        this.fileName = fileName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Hall getIdHall() {
        return idHall;
    }

    public void setIdHall(Hall idHall) {
        this.idHall = idHall;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HallImg)) {
            return false;
        }
        HallImg other = (HallImg) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.HallImg[ id=" + id + " ]";
    }
    
}
